1. Field of the Invention
This invention relates to the field of computer programming and, more particularly, to isolating errors within computer program code or hardware design languages.
2. Description of the Related Art
Locating errors, or “bugs”, in computer program code, a programming language, or a hardware design language (hereafter “code”) can be a very difficult and time consuming process. This is especially true when developing software-based development tools such as parsers, translators, analyzers, simulation engines, synthesizers, code generators, and the like. Many aspects of the debugging and testing process still are largely manual in nature. Such is the case whether the code, or software, to be debugged is written in a high level programming language such as C or a hardware description language (HDL) used for designing logic and/or integrated circuits.
Code can be tested by subjecting the code to a variety of different test cases. The test cases can be implemented using a software-based simulator, an integrated development environment, or other test system. Each test case can be designed to verify one or more particular functions of the code under development. By comparing the results of each test case against known or expected results, errors within the code under test can be identified. The presence of an error within the code is noted when the software fails one or more test cases. When an error is found, a developer manually examines the failing code to form a hypothesis as to which portion of the code caused the failure.
The developer manually selects a fragment of code believed to be the likely cause of the failure and either removes the code fragment from the software or modifies it. Once this candidate code fragment is removed or modified, the remaining code can be retested using updated test cases. If the program passes the test case(s) that previously failed, the developer determines that the candidate code fragment likely was the source of the error.
If the test case(s) fail despite the removal or modification of the candidate code fragment from the software, the developer determines that another code fragment is the source of the failure. At that point, the candidate code fragment can be reinserted into the software and another code fragment can be selected for removal. The developer can continue to select and remove and/or modify code fragments until the software passes the previously failed test case or cases. Once it is determined that a particular code fragment was the cause of the failure, the developer can devote more time to correcting any errors within that code fragment. Thus, the developer is left with fewer lines of code to debug.
Although more efficient than a detailed review of the entire code, this manual process still can take days for a developer to complete. It would be beneficial to have an automated technique for locating errors within computer code that overcomes the deficiencies described above.